<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>后盾人</title>
  </head>
  <body>
    <div desc="houdunren">在线学习</div>
    <div desc="hdcms">开源产品</div>
  </body>
  <script>
    let divs = document.querySelectorAll("div");
    divs.forEach(function(item) {
      let desc = item.getAttribute("desc");
      item.addEventListener("click", function() {
        // console.log(item.getAttribute("desc"));
        console.log(desc);
        console.log(item);
      });
      item = null;
    });
  </script>
</html>
